﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace StreetlightGames.XnaEngine
{
    public class RandomHelper
    {
        Random _random;

        /// <summary>Gets the Instance value</summary>
        public static RandomHelper Instance
        {
            get { return _instance; }
        }
        private static RandomHelper _instance = new RandomHelper();

        public RandomHelper()
        {
            _random = new Random();
        }

        public static double NextDouble(double min, double max)
        {
            return min + (max - min) * Instance._random.NextDouble();
        }

        public static float NextFloat()
        {
            return (float)Instance._random.NextDouble();
        }

        public static float NextFloat(float min, float max)
        {
            return min + (max - min) * NextFloat();
        }

        public static float RandomSign()
        {
            return Instance._random.Next(0, 2) == 0 ? -1f : 1f;
        }
    }
}
